// pages/check/gysenter/gysenter.js
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		region: ['', '', ''],
		map: '',
		name: '',
		mobile: '',
		text1: '',
		id: '',
		zt: false
	},

	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad: function(options) {
		this.setData({
			type: options.id
		})
	},
	bindRegionChange: function(e) {
		this.setData({
			region: e.detail.value
		})
	},
	name(e) {
		this.setData({
			name: e.detail.value
		})
	},
	map(e) {
		this.setData({
			map: e.detail.value
		})
	},
	mobile(e) {
		this.setData({
			mobile: e.detail.value
		})
	},
	zt(e) {
		this.setData({
			zt: !(e.currentTarget.dataset.id)
		})
	},
	goin() {
		if (this.data.name != '' && this.data.map != '' && this.data.mobile != '' && this.data.region[0] != '' && this.data
			.id != '' && this.data.text1 != '' && this.data.zt == true) {
			let a = this.data.id
			a = a.join()
			wx.navigateTo({
				url: '../list/list?shopName=' + this.data.name + '&mobile=' + this.data.mobile + '&shopAddress=' + this.data.map +
					'&shopType='+this.data.type+'&shopInfo=' + this.data.text1 + '&prov=' + this.data.region[0] + '&city=' +
					this.data.region[1] + '&county=' + this.data.region[2] + '&serverType=' + a+'&zhuangtai=1'
			})
		} else {
			wx.showToast({
				icon: 'none',
				title: '请正确填写信息'
			})
		}
	}
})
